<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<% 
String _basePath = request.getContextPath();
String ctx = request.getContextPath();

response.setContentType("application/vnd.ms-excel");
String filename = new String(("任务统计").getBytes(),"ISO-8859-1");
response.addHeader("Content-Disposition", "filename=" + filename + ".xls");
%>

<meta http-equiv="Content-Type" content="application/vnd.ms-excel; charset=utf-8" />
<table class="table-striped" border="1">
	<thead>
		<tr>
			<th width="150">部门</th>
			<th width="80">人员</th>
			<th width="150">区域</th>
			<th width="100">出勤天数</th>
			<th width="100">完成任务数</th>
		</tr>
	</thead>
	<c:forEach var="user" items="${users}" varStatus="status">
	<tbody>
		<c:set var="statses" value="${user.stats}"></c:set>
		<c:forEach var="item" items="${statses}" varStatus="statsStatus">
			<tr>
				<c:if test="${statsStatus.index eq 0}">
			    	<td rowspan="${fn:length(statses)}">${user.organName}</td>
			    	<td rowspan="${fn:length(statses)}">${user.name}</td>
		    	</c:if>
		    	<td>${item.county}</td>
		    	<td>${item.dateCount}</td>
		    	<td>${item.taskCount}</td>
			</tr>
		</c:forEach>
	</tbody>
	</c:forEach>
</table>
